<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>钱包盒子-服务</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../Public/css/Home/mui.css" />
		<link rel="stylesheet" href="../Public/css/Home/public.css" />
		<link rel="stylesheet" href="../Public/css/Home/main.css" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 id="title" class="mui-title">文章列表</h1>
		</header>
		<div class="mui-content mui-scroll-wrapper">
			<div class="mui-scroll">
				<ul id="newsList" class="newslist">
					
				</ul>
			</div>
		</div>
	</body>
	<script src="../Public/js/Home/jquery.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../Public/js/Home/mui.js" type="text/javascript" charset="utf-8"></script>
	<script src="../Public/js/Home/common.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		var flag;
		mui.init();

		mui('.mui-scroll-wrapper').scroll({
			deceleration: 0.0005
		});
		
		$(function() {
			flag = common.getLocVal("flag");
			newsList()
		});
		
		function newsList() {
			var params = {
				url: 'News/getNewsListByFlag',
				data: {
					flag: flag
				}
			}
			common.JsonPost(params, newsListHtml);
		}

		function newsListHtml(data) {
			document.getElementById("title").innerHTML = data.cateInfo.cate_name;
			var html = "";
			mui.each(data.newsList.data, function(key, item) {
				var img = "";
				if(item.pic){
					img = '<img class="img" src="' + SERVER_PATH + item.pic + '" />';
				}
				html += '<li thisId="' + item.id + '" class="layout-box">'+
							'<div class="cont flex-item1">'+
								'<div class="tit mui-ellipsis">' + item.title + '</div>'+
								'<p class="text mui-ellipsis-2">' + item.description + '</p>'+
							'</div>'+ img +
						'</li>';
			});
			if(html != "") {
				document.getElementById("newsList").innerHTML = html;
			}
		}
		
		//详情页面
		mui('#newsList').on('tap', 'li', function() {
			var newsid = this.getAttribute("thisId");
			common.setLocVal("newsId",newsid);
			mui.openWindow({
				url: "./article_detail.html",
				id: "article_detail",
				extras: {
					newsId: newsid
				}
			});
		})
	</script>

</html>